//友元类
#include <iostream>
#include <string.h>
#include <unistd.h>
using namespace std;

//电视机类
class TV
{
    int channel;

    friend class Remoter;
};

//遥控器类
class Remoter
{
public:
    void setChannel(TV &r,int c)
    {
        r.channel = c;
    }
};

int main(int argc, char const *argv[])
{
    TV xiaomi;
    Remoter r;

    r.setChannel(xiaomi,5);
}
